const http = require('http');
const querystring  = require('querystring');
http.createServer((req,res) => {
    if(req.url === '/favicon.ico'){
        res.end();
        return;
    }
    console.log('req.url====>>>',req.url);
    let str = "";
    //post 数据处理  数据会存在body中
    //事件
    req.on('data', chunk => {
        str+= chunk;
    })
    req.on('end',() => {
        console.log('接收完毕');
        let obj = querystring.parse(str);

        console.log('obj --->',obj);
    });
}).listen(8080,() => {
    console.log('running....');
})